# -*- coding: utf-8 -*-
"""
    settings file for production environment, including password configuration, avoid leakage!！！
    The deployment script will automatically replace the production environment configuration files
"""
from backend.base import *


# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

INSTALLED_APPS += [
    'drf_yasg',
]

# Database
# https://docs.djangoproject.com/en/5.1/ref/settings/#databases

DATABASES = {
    'default0': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3'},
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'neu_dev',
        'USER': 'neu_backend',
        'PASSWORD': '0@b&7ze7xw&!3',
        'HOST': '119.29.173.4',
        'PORT': '8432',
    },
}

LANGUAGE_CODE = 'zh-hans'
TIME_ZONE = 'Asia/Shanghai'


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.1/howto/static-files/

# Media files (uploads)
MEDIA_ROOT = BASE_DIR.parent.parent / 'data'

SWAGGER_SETTINGS = {
    # 'DEFAULT_AUTO_SCHEMA_CLASS': 'utils.swagger.CustomSwaggerAutoSchema',
    'SECURITY_DEFINITIONS': {'basic': {'type': 'basic'}},
    'LOGIN_URL': 'rest_framework:login',
    'LOGOUT_URL': 'rest_framework:logout',
}

# reids_configure
# CACHES = {
#     "default": {
#         "BACKEND": "django_redis.cache.RedisCache",
#         "LOCATION": "redis://119.29.173.4:6389",
#         "OPTIONS": {
#             "CLIENT_CALSS": "django_redis.client.DefaultClient",
#             "CONNECTION_POOL_KWARGS": {"max_connections": 128},
#             "PASSWORD": "Youxiao@8078",
#         }
#     }
# }

# Email Configuration
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.qq.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = 'zeaning@qq.com'
EMAIL_HOST_PASSWORD = 'glczcdeyazjybjhb'
# EMAIL_FROM = 'Neusician Test'
# EMAIL_USE_LOCALTIME = True
# when an Error level or higher error occurs, it will automatically send an email to the list configured in ADMINS, and SERVER_EMAIL needs to be configured to send successfully
SERVER_EMAIL = 'zeaning@qq.com'
ADMINS = [('zeaning', 'zeaning@qq.com'), ]
